<template>
  <div class="columninfo">
    <div class="bg-title">
        <img :src="background_image" >
        <div class="desc-wrap">
            <div class="title">{{title}}</div>
            <div class="author">{{author_name}}</div>
        </div>
        <div class="mask"></div>
    </div>
    <div class="desc">
        <div class="text">{{introduction}}</div>
        <div class="count">
            <div class="video-count"><van-icon name="video-o" /> {{material_count}}视频</div>
            <div class="pay-count"><van-icon name="play-circle-o" /> {{play_count}}播放</div>
        </div>
    </div>
    <div class="list">
        <div class="list-item" v-for="item in list" :key="item.nid" @click="jumpDetails">
            <div class="img-wrapper">
                <img src="../../assets/img1.jpg" >
                <div class="play-info">
                    <div class="play-num">{{item.play_count}}播放</div>
                    <div class="play-time">{{item.duration}}</div>
                </div>
            </div>
            <div class="tit-info">
                <div class="title">{{item.title}}</div>
                <div class="publish">{{item.publish_time}}</div>
            </div>
        </div>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'columninfo',
  data() {
    return {
        introduction:'',
        background_image:'',
        author_name:'',
        title:'',
        play_count:'',
        material_count:'',
        list:[]
    }
  },
  async created() {
    await axios.get('http://localhost:9527/columninfo.json').then(res=>{
        this.introduction = res.data.Result.introduction
        this.background_image = res.data.Result.background_image
        this.author_name = res.data.Result.author_name
        this.title = res.data.Result.title
        this.material_count = res.data.Result.material_count
        this.play_count = res.data.Result.play_count
        this.list = res.data.Result.issue_list
        console.log(res.data.Result);
    })
  },
  methods:{
    jumpDetails(){
        this.$router.push('/videodetails')
    }
  }
}
</script>

<style lang="scss" scoped>
.columninfo {
    padding-top: 46px;
    .bg-title {
        width: 100%;
        height: 158px;
        position: relative;
        img {
            width: 100%;
            height: 100%;
        }
        .desc-wrap {
            position: absolute;
            bottom: 15px;
            left: 15px;
            z-index: 9;
            .title {
                font-size: 22px;
                color: #fff;
                line-height: 22px;
                margin-bottom: 10px;
            }
            .author {
                font-size: 12px;
                color: #fff;
            }
        }
        .mask{
            width: 100%;
            height: 100%;
            position: absolute;
            top:0;
            left: 0;
            background-image: linear-gradient(180deg,rgba(17,18,20,.1),rgba(17,18,20,.9) 91%);
        }
    }
    .desc {
        padding: 17px;
        box-sizing: border-box;
        .text {
            font-size: 14px;
            color: #4F535E;
        }
        .count {
            display: flex;
            color: #4F535E;
            font-size: 12px;
            margin-top: 10px;
            div {
                margin-right: 10px;
            }
        }
    }
    .list {
        padding: 17px;
        box-sizing: border-box;
        .list-item {
            width: 100%;
            border-bottom: 1px solid #F8F8F8;
            margin-bottom: 30px;
            .img-wrapper {
                width: 100%;
                height: 190px;
                border-radius: 5px;
                position: relative;
                img {
                    width: 100%;
                    height: 100%;
                    border-radius: 5px;
                }
                .play-info{
                    display: flex;
                    justify-content: space-between;
                    width: 100%;
                    padding: 0 20px;
                    box-sizing: border-box;
                    position: absolute;
                    left: 0;
                    bottom: 10px;
                    color: #fff;
                    font-size: 12px;
                }
            }
            .tit-info {
                margin: 10px 0;
                position: relative;
                .title {
                    font-size:18px;
                    color: #242a33;
                    line-height: 28px;
                    margin-right: 70px;
                }
                .publish {
                    font-size: 12px;
                    color: #a1a7b3;
                    position: absolute;
                    right: 0;
                    top: 0;
                }
            }
        }
    }
}
</style>
